﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace DiscoveryLogic.UI.Charts
{
    /// <summary>
    /// Charts.SectorChartShapeParams class
    /// (Used for Pie and Doughnut charts)
    /// </summary>
    internal class SectorChartShapeParams
    {
        #region Public Methods

        #endregion

        #region Public Properties

        /// <summary>
        /// Get the fixed angle
        /// </summary>
        /// <param name="angle">Angle</param>
        /// <returns>Angle</returns>
        public Double FixAngle(Double angle)
        {
            while (angle > Math.PI * 2) angle -= Math.PI;
            while (angle < 0) angle += Math.PI;
            return angle;
        }

        /// <summary>
        /// OuterRadius of the pie
        /// </summary>
        public Double OuterRadius
        {
            get;
            set;
        }

        /// <summary>
        /// InnerRadius of the Pie
        /// </summary>
        public Double InnerRadius
        {
            get;
            set;
        }

        /// <summary>
        /// StartAngle of the Pie
        /// </summary>
        public Double StartAngle
        {
            get
            {
                return _startAngle;
            }
            set
            {
                _startAngle = value;
            }
        }

        /// <summary>
        /// StopAngle of the Pie
        /// </summary>
        public Double StopAngle
        {
            get
            {
                return _stopAngle;
            }
            set
            {
                _stopAngle = value;
            }
        }

        /// <summary>
        /// Center position
        /// </summary>
        public Point Center
        {
            get;
            set;
        }

        /// <summary>
        /// X Offset value
        /// </summary>
        public Double OffsetX
        {
            get;
            set;
        }

        /// <summary>
        /// Y Offset value
        /// </summary>
        public Double OffsetY
        {
            get;
            set;
        }

        /// <summary>
        /// Whether it is a LargerArc
        /// </summary>
        public Boolean IsLargerArc
        {
            get;
            set;
        }

        /// <summary>
        /// Whether the lighting is enabled
        /// </summary>
        public Boolean Lighting
        {
            get;
            set;
        }

        /// <summary>
        /// Whether the Bevel effect is applied
        /// </summary>
        public Boolean Bevel
        {
            get;
            set;
        }

        /// <summary>
        /// Background color of the pie
        /// </summary>
        public Brush Background
        {
            get;
            set;
        }

        /// <summary>
        /// Whether the value for pie is zero
        /// </summary>
        public bool IsZero
        {
            get;
            set;
        }

        /// <summary>
        /// YAxis scale value
        /// </summary>
        public Double YAxisScaling
        {
            get
            {
                return Math.Sin(TiltAngle);
            }
        }

        /// <summary>
        /// ZAxis scale value
        /// </summary>
        public Double ZAxisScaling
        {
            get
            {
                return Math.Cos(Math.PI / 2 - TiltAngle);
            }
        }

        /// <summary>
        /// 3D depth value
        /// </summary>
        public Double Depth
        {
            get;
            set;
        }

        /// <summary>
        /// ExplodeRatio varies from 0 to 1 
        /// </summary>
        public Double ExplodeRatio
        {
            get;
            set;
        }

        /// <summary>
        /// Width of the PlotArea
        /// </summary>
        public Double Width
        {
            get;
            set;
        }

        /// <summary>
        /// Height of the PlotArea
        /// </summary>
        public Double Height
        {
            get;
            set;
        }

        /// <summary>
        /// TiltAngle for pie, used for 3d Pie
        /// </summary>
        public Double TiltAngle
        {
            get;
            set;
        }

        /// <summary>
        /// Position of the label
        /// </summary>
        public Point LabelPoint
        {
            get;
            set;
        }

        /// <summary>
        /// Color of the label line
        /// </summary>
        public Brush LabelLineColor
        {
            get;
            set;
        }

        /// <summary>
        /// Thickness of the label line
        /// </summary>
        public Double LabelLineThickness
        {
            get;
            set;
        }

        /// <summary>
        /// LineStyle of the line for label
        /// </summary>
        public DoubleCollection LabelLineStyle
        {
            get;
            set;
        }

        /// <summary>
        /// Whether line is enabled for labels
        /// </summary>
        public Boolean LabelLineEnabled
        {
            get;
            set;
        }

        /// <summary>
        /// Mean angle of a pie
        /// </summary>
        public Double MeanAngle
        {
            get;
            set;
        }

        /// <summary>
        /// Storyboard associated with animation
        /// </summary>
        public Storyboard Storyboard
        {
            get;
            set;
        }

        /// <summary>
        /// Whether animation is enabled
        /// </summary>
        public Boolean AnimationEnabled
        {
            get;
            set;
        }

        #endregion

        #region Data

        /// <summary>
        /// Start angle
        /// </summary>
        private Double _startAngle;

        /// <summary>
        /// End angle
        /// </summary>
        private Double _stopAngle;

        #endregion
    }
}
